; fuck
#include <WindowsConstants.au3>
#include <File.au3>
#include <Array.au3>
#Include <GuiListView.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#Include <GuiButton.au3>
#include <GuiTab.au3>
#Include <Color.au3>
#include <GDIP.au3>
Global $bg_img_file, $bgImage, $width, $height, $buffer, $GUI3, $pvGraphic
_GDIPlus_GraphicsClear($Buffer, 0x7F000000)
	$bg_img_file=FileOpenDialog("Please select an image file for background", "", "Images (*.jpg;*.bmp;*.png)", 1 + 2 )
	if($GUI3 <>0) then
		GUIDelete($GUI3)
		$GUI3=0
	endif
	$GUI3=GuiCreate("Preview Window", 800, 600)
	;GUISetOnEvent($GUI_EVENT_CLOSE, "GUI3_close")
	;GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT = 0x000F
	GUISetState()
	$pvGraphic = _GDIPlus_GraphicsCreateFromHWND ($GUI3)
	$bitmap=_GDIPlus_BitmapCreateFromGraphics(800,600,$pvGraphic)
	$buffer=_GDIPlus_ImageGetGraphicsContext($bitmap)
	;$buffer=_GDIPlus_ImageGetGraphicsContext($bitmap)
	$bgImage   = _GDIPlus_BitmapCreateFromFile($bg_img_file)
	if $bgImage ==0 Then
		msgbox(0,"fuck",$bgImage)
	endif